﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MetroFramework.Forms;
using Managistics.Warehouse.Views.Interfaces;

namespace Managistics.Warehouse.Views
{
    public partial class SubForm : MetroForm, ISubView
    {
        public SubForm()
        {
            InitializeComponent();

            base.Closed += delegate { Closed(); };

            Disposed += OnDisposed;
        }

        public event Action ClickGetParameterButtonClicked = delegate { };
        public event Action ClickImportRelationsButtonClicked = delegate { };

        public new event Action Closed = delegate { };

        public void Open()
        {
            ShowDialog();
        }

        public void Open(IView view)
        {
            return;
        }

        public void SetText(string text)
        {
            lblParameter.Text = text;
        }

        void OnDisposed(object sender, EventArgs e)
        {
            MessageBox.Show(string.Format(@"The Subform Disposed!"));
        }

        private void btnGetParameter_Click(object sender, EventArgs e)
        {
            ClickGetParameterButtonClicked();
        }

        private void btnImportToCreateRelation_Click(object sender, EventArgs e)
        {
            ClickImportRelationsButtonClicked();
        }
    }
}
